package top.huhuiyu.spirngboot2.total.service;

import org.springframework.transaction.annotation.Transactional;
import top.huhuiyu.spirngboot2.total.base.BaseDataResult;
import top.huhuiyu.spirngboot2.total.base.BaseResult;
import top.huhuiyu.spirngboot2.total.entity.TbUser;
import top.huhuiyu.spirngboot2.total.vo.UserInfo;

public interface AuthService {
    int ROLE_USER = 2;
    String PWD_ERROR_KEY = "password_error_%s";
    long PWD_ERROR_EXPIRE = 60 * 1000L;
    int PWD_ERROR_COUNT = 10;

    BaseDataResult<UserInfo> getLoginUser();

    UserInfo queryById(Integer uid);

    @Transactional
    BaseResult reg(TbUser tbUser);

    boolean checkAuth();

    BaseResult login(TbUser user);
}
